<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
	<title>my-info</title>
		
		<!--我的个人中心-->
		<link rel="stylesheet" type="text/css" href="{{__PUBLIC__}}/Home/css/my-center.css" />
		<!--城市联动-->
		<script type="text/javascript" src="{{__PUBLIC__}}/area/jquery-1.8.2.min.js"></script>
		<script type="text/javascript" src="{{__PUBLIC__}}/area/area.js"></script>
		<script type="text/javascript">
			$(function(){
				//初始化方法
				area.init('area');
				//修改的时候默认被选中效果
				area.selected('黑龙江','哈尔滨','道里区');
			})
		</script>
		
		

			{{include file="VIEW_PATH/Common/header.php"}}
			<!--个人中心开始-->
			<div id="ms-header-menu">
				<div class="ms-header-menu-inner">
					<div class="ms-logo">
						
					</div>
					<div class="ms-nav">
						<ul>
							<li><a class="nav-tou" href="">首页</a></li>
							<li>
								<a class="nav-tou" href="">账户管理</a>
								<em>&nbsp;&nbsp;</em>
								<!--二级菜单-->
								<div id="list-nav-manage">
									<div class="list-nav-manage-lst">
										<p>安全设置</p>
										<p><a href="">修改密码</a></p>
										<p><a href="">邮箱管理</a></p>
									</div>
									<div class="list-nav-manage-lst">
										<p>个人信息</p>
										<p><a href="">地址管理</a></p>
										<p><a href="">我的易付宝</a></p>
									</div>
									<div class="list-nav-manage-lst">
										<p>帐号绑定</p>
										<p><a href="">关联互联号</a></p>
										<p><a href="">易付宝绑定管理</a></p>
									</div>
								</div>
							</li>
							<li><a class="nav-tou" href="">消息</a></li>
						</ul>
						<div class="ms-serch">
							<input type="text" name="" id="" value="" />
							<a class="serch-img" href=""></a>
						</div>
					</div>
					
				</div>
				
			</div>
			<div id="ms-userinfo">
						
			</div>
			<div id="ms-content">
				<!--侧边导航开始-->
				{{include file="VIEW_PATH/Common/left.php"}}				
				
				<!--侧边导航结束-->
				
						<!--修改手机号或者邮箱-->
						<script type="text/javascript">
							$(function(){
								$('.phone-ma-a').live('click',function(){
//									获取原值
									var borther = $(this).siblings('.phone-ma').text();
//									alert(borther);
//									将原来的框隐藏，新建一个input框									
									$(this).parents('.control-grop').find('.phone-ma').remove();
									var inp = '<input class="inp" type="text" name="cellphone" value="' +borther+ '" />';
									$(this).before(inp);
									
//									将当前元素右修改变为确定按钮,并追加一个class
									$(this).text('确定');
									$(this).removeClass('phone-ma-a');
									$(this).addClass('sure_change');
								})
							})
						</script>
						<!--确定修改按钮-->
						<script type="text/javascript">
							$(function(){
								$('.sure_change').live('click',function(){
									var borther = $(this).siblings('.inp').val();
//									alert(borther); return;
//									将隐藏域中的value也修改
									$(this).siblings('.hidden_inp').val(borther);
//									将原来的框隐藏，新建一个span标签
									$(this).siblings('.inp').remove();
									var spa = '<span class="phone-ma">'+borther+'</span>';
									$(this).before(spa);
									$(this).text('修改');
									$(this).addClass('phone-ma-a');
									$(this).removeClass('sure_change');
									
								})
							})
						</script>
				<!--个人信息开始-->
				<form id="form" action="" method="post">
				<div id="my-info">
					<div class="mian-wrap">
						<h3>个人信息</h3>
						<div class="user-profile">
							<div class="user-phone">
								<img src="{{__PUBLIC__}}/Home/img/center/0000000000_01_120x120.jpg" alt="" />
								<a class="edit-phone" href="">编辑头像</a>
							</div>
							<div class="profile-info">
								<input class="user-name" type="" name="account" id="" value="{{$userData['account']}}" />
							</div>
						</div>
						
						
						<!--主体信息-->
							<input type="hidden" name="uid" id="uid" value="{{$userData['uid']}}" />
						<div id="files-info">
							<div class="control-grop">
								<label for=""><i>*</i>真实姓名:&nbsp;</label>
								<input type="text" name="truename" id="" value="{{$userData['truename']}}" />
							</div>
							<div class="control-grop">
								<label for=""><i>*</i>昵称:&nbsp;</label>
								<input type="text" name="username" id="" value="{{$userData['username']}}" />
							</div>
							<div class="control-grop">
								<label for=""><i>*</i>性别:&nbsp;</label>
								<input type="radio" name="sex" id="" value="男" {{if value="$userData['sex'] == '男'"}}  checked="checked" {{endif}} />
								<span>男</span>
								<input type="radio" name="sex" id="" value="女" {{if value="$userData['sex'] == '女'"}}  checked="checked" {{endif}}  />
								<span>女</span>
								<input type="radio" name="sex" id="" value="保密" {{if value="$userData['sex'] == '保密'"}}  checked="checked" {{endif}}  />
								<span>保密</span>
							</div>
							<div class="control-grop">
								<label for=""><i>*</i>手机:&nbsp;</label>
								{{if value="!empty($userData['cellphone'])"}}
								<span class="phone-ma">{{$userData['cellphone']}}</span>
								<a class="phone-ma-a" href="javascript:;">修改</a>
								<input type="hidden" class="hidden_inp" name="cellphone" id="" value="{{$userData['cellphone']}}" />
								{{else}}
								<input type="" name="cellphone" value="" />
								{{endif}}
								
							</div>
							<div class="control-grop">
								<label for=""><i>*</i>邮箱:&nbsp;</label>
								{{if value="!empty($userData['cellphone'])"}}
								<span class="phone-ma">{{$userData['email']}}</span>
								<a class="phone-ma-a" href="javascript:;">修改</a>
								<input type="hidden" class="hidden_inp" name="email" id="" value="{{$userData['email']}}" />
								{{else}}
								<input type="" name="email" value="" />
								{{endif}}
							</div>
							<div class="control-grop">
								<label for=""><i>*</i>出生日期:&nbsp;</label>
								<input type="date" name="birthday" id="" value="{{$userData['birthday']}}" />
							</div>
							<div class="control-grop">
								<label for=""><i>*</i>居住地区:&nbsp;</label>
								
								
									<input style="width: 400px;" type="text" name="address" id="" value="{{$userData['address']}}" />
							</div>
							<div class="control-grop">
								<label for=""><i>*</i>验证码:&nbsp;</label>
								<input type="text" name="" id="" value="" />
								<img src="" alt="" />
								<a href="">换一个</a>
							</div>
							<div class="control-grop">
								<label for=""></label>
								<a class="baocun-info edit-infor" href="javascript:;">保存</a> 
							</div>
						</div>
					</div>
				</div>
				
				</form>
				<!--点击保存，发ajax，进行修改-->
				<script type="text/javascript">
					$(function(){
						$('.edit-infor').click(function(){
//									alert(1);return;
							var form = $('#form').serialize();
//									alert(form);
							$.ajax({
								type:"post",
								url:"{{U('edit')}}",
								data:form,
								dataType:'json',
								success:function(phpData){
									if(phpData.result){
										alert('修改成功');
										location.href = "{{U('index')}}";
									}else{
										alert(phpData.errors);
									}
									
									
								}
								
								
								
							});
							
							
							
							
							
							
							
						})
					})
				</script>
				
				
				
				
				<!--个人信息结束-->
				
				
				
				
				
			</div>
			
			
			
			<!--个人中心结束-->
			
			
			{{include file="VIEW_PATH/Common/footer.php"}}
</body>
</html>